{% extends 'base.html' %}
{% block content %}
<div class="messages">
    {% for message in object.messages.all %}
    <div class="message {% if message.sender == user %}sent{% else %}received{% endif %}">
        <p>{{ message.content }}</p>
        <small>{{ message.timestamp }}</small>
    </div>
    {% endfor %}
</div>

<form method="post">
    {% csrf_token %}
    {{ form.as_p }}
    <button type="submit">Send</button>
</form>
{% endblock %}